<div id="content-wrapper" class="corner">
<?php foreach ($invoices as $invoice): ?>
<span class="list-item">
<span class="item-id">
    <a href="<?php if ($sf_params->get('companyNameUrl')) :
        echo url_for('invoices/show?id_invoice='.$invoice->getIdInvoice().'&companyNameUrl='.$sf_params->get('companyNameUrl'));
    else :
        echo url_for('invoices/show?id_invoice='.$invoice->getIdInvoice());
    endif;?>">Invoice ID: <?php echo $invoice->getIdInvoice() ?></a></span>
<span class="titulo-item">
   Billing Name: <span class="item-result"> <?php echo $invoice->getBillingName() ?> <?php echo $invoice->getBillingLastName() ?></span>
</span>
  &nbsp;&nbsp;&nbsp;&nbsp;
  <span class="titulo-item">
    Transaction ID: <span class="item-result"><?php echo $invoice->getIdTransaction() ?></span>
  </span>
  <span class="titulo-item">
    Amount: <span class="item-result"><?php echo $invoice->getInvoiceAmount() ?></span>
  </span>
          &nbsp;
         <span class="titulo-item">
    	 Date: <span class="item-result"><?php echo date('m-d-Y', strtotime($invoice->getCreatedAt())); ?></span></span>
         &nbsp;
         <span class="titulo-item">
    	 Payment: <span class="item-result-status">
                <?php

		 	if($invoice->getIsPaid() == 1){

				echo "Approved";

			}else{

					echo 'Not Approved';

				} ?>
         </span></span>

</span>
<?php endforeach; ?>

<div class="pagination">
<?php if ($pager->haveToPaginate()): ?>
  <span><?php echo 'Showing from '.$pager->getFirstIndice().' to '.$pager->getLastIndice().' of '.$pager->count().' orders'; ?></span><br/>
  <?php if (!$pager->isFirstPage()) :  ?>
  <a href="<?php echo url_for('invoices/myOrders') ?>"><?php echo 'First' ?></a>

  <a href="<?php echo url_for('invoices/myOrders') ?>?page=<?php echo $pager->getPreviousPage() ?>"><?php echo 'Previous' ?></a>
  <?php endif; ?>

  <?php foreach ($pager->getLinks() as $page): ?>
    <?php if ($page == $pager->getPage()): ?>
      <?php echo $page ?>
    <?php else: ?>
      <a href="<?php echo url_for('invoices/myOrders') ?>?page=<?php echo $page ?>"><?php echo $page ?></a>
    <?php endif; ?>
  <?php endforeach; ?>

  <?php if (!$pager->isLastPage()) :  ?>
  <a href="<?php echo url_for('invoices/myOrders') ?>?page=<?php echo $pager->getNextPage() ?>"> <?php echo 'Next' ?></a>

  <a href="<?php echo url_for('invoices/myOrders') ?>?page=<?php echo $pager->getLastPage() ?>"><?php echo 'Last' ?></a>
  <?php endif; ?>

<?php endif; ?>
</div>

</div>
